EMT Practice Test

1. Question Content...


Question List

Question1: A developer created an Opportunity trigger that updates the account rating when an associated opportunity is considered high value. Current criteria for an opportunity to be considered high value is an amount greater than or equal to $1,000,000. However, this criteria value can change over time.
There is a new requirement to also display high value opportunities in a Lightning web component.
Which two actions should the developer take to meet these business requirements, and also prevent the business logic that obtains the high value opportunities from being repeated in more than one place?
Choose 2 answers

Question2: Refer to the markup below:

A Lightning web component displays the Account name and two custom fields out of
275 that exist on the abject. The custom fields are correctly declared and populated. However, the developer receives complaints that the component performs slowly.
What can the developer do to improve the performance?

Question3: A company has code to update a Request and Request Lines and make a callout to their external ERP system's REST endpoint with the updated records.

The callousUtil.makeRestCallout fails with a "You have uncommitted work pending. Please commit or rollback before calling cut' error.
What should be done to address the problem?

Question4: When developing a Lightning web component, which setting displays lightninglayout-items im one column on small devices, such as mobile phones, and in two columns on tablet-size and desktop-size screens?

Question5: An Apex class does not achieve expected code coverage. The testsetup method explicitly calls a method In the Apex class..
How can the developer generate the code coverage?

Question6: A developer created the following test method:

The developer org has five accounts where the name starts with "Test". The developer executes this test in the Developer Console.
After the test code runs, which statement is true?

Question7: Refer to the test method below:

The test method calls an @future method that increments the
Number_of_Times_Viewed__c value. The assertion is failing because the
Number of Times Viewed_c equals 0.
What is the optimal way to fix this?

Question8: Which statement is true regarding savepoints?

Question9: A developer created 2 class that implements the Queueable Interface, as follows:

As part of the deployment process, the developer is asked to create a corresponding test class.
Which two actions should the developer take to successfully execute the test class?
Choose 2 answers

Question10: Universal Containers wants to notify an external system in the event that an unhandled exception occurs when their nightly Apex batch job runs.
What is the appropriate publish/subscribe logic to meet this requirement?

Question11: A developer is asked to find a way to store sacret data with an ability to specify which profiles and users can access which secrets.
What should be used to store this data?

Question12: A developer has a requirement to query three fields (Id, Name, Type) from an Account; and first and last names for all Contacts associated with the Account.
Which option is the preferred, optimized method to achieve this for the Account named 'Ozone Electronics'?

Question13: A developer is creating a page in App Builder that will be used in the Salesforce mobile app.
Which two practices should the developer follow to ensure the page operates with optimal performance?
Choose 2 answers

Question14: Refer to the exhibit

Users of this Visualforce page complain that the page does a full refresh every time the Search button Is pressed.
What should the developer do to ensure that a partial refresh Is made so that only the section identified with opportunity List is re-drawn on the screen?

Question15: Which three approaches should a developer implement to obtain the best performance for data retrieval when building a Lightning web component? Choose 3 answers

Question16: An org records customer order information in a custom object, ordar__c, that has fields for the shipping address. A developer is tasked with adding code to calculate shipping charges on an order, based on a flat percentage rate associated with the region of the shipping address.
What should the developer use to store the rates by region, so that when the changes are deployed to production no additional steps are needed for the calculation to work?

Question17: Instead of waiting to send emails to support personnel directly from the finish method of a batch Apex process, Universal Containers wants to notify an external system in the event that an unhandled exception occurs.
What is the appropriate publish/subscribe logic to meet this requirement?

Question18: Given the following information regarding Universal Containers (UC):
* UC represents their customers as Accounts in Salesforce.
* All customers have a unique Customer__Number_c that is unique across all of UC's systems.
* UC also has a custom Invoice c object, with a Lookup to Account, to represent invoices that are sent out from their external system.
UC wants to integrate invoice data back into Salesforce so Sales Reps can see when a customer pays their bills on time.
What is the optimal way to implement this?

Question19: Refer to the following code snippets:
A developer is experiencing issues with a Lightning web component. The component must surface information about Opportunities owned by the currently logged-in user.

When the component is rendered, the following message is displayed: "Error retrieving data".
Which modification should be implemented to the Apex class to overcome the issue?

Question20: Universal Containers analyzes a Lightning web component and its Apex controller class that retrieves a list of contacts associated with an account. The code snippets are as follows:

Based on the code snippets, what change should be made to display the contacts' mailing addresses in the Lightning web component?

Question21: A developer is asked to replace the standard Case creation screen with a custom screen that takes users through a wizard before creating the Case. The org only has users running Lightning Experience.
What should the developer override the Case New Action with to satisfy the requirements?

Question22: A developer is asked to build a solution that will automatically send an email to the customer when an Opportunity stage changes. The solution must scale to allow for 10,000 emails per day. The criteria to send the email should be evaluated after certain conditions are met.
What is the optimal way to accomplish this?

Question23: What should be added to the setup, in the location indicated, for the unit test above to create the controller extension for the test?

Question24: Universal Containers develops a Visualforce page that requires the inclusion of external JavaScript and C55 files. They want to ensure efficient loading and caching of the page.
Which feature should be utilized to achieve this goal?

Question25: A company has a native iOS order placement app that needs to connect to Salesforce to retrieve consolidated information from many different objects in a JSON format.
Which is the optimal method to implement this in Salesforce?

Question26: A Salesforce developer is hired by a multi-national company to build a custom Lightning application that shows employees their employment benefits and earned commissions over time. The application must acknowledge and respect the user's locale context for dates, times, numbers, currency, and currency symbols.
When using Aura components, which approach should the developer implement to ensure the Lightning application complies with the user's locale?

Question27: Consider the following code snippet:

The Apex method is executed in an environment with a large data volume count for Accounts, and the query is performing poorly.
Which technique should the developer implement to ensure the query performs optimally, while preserving the entire result set?

Question28: A company has reference data stored in multiple custom metadata records that represent default information and delete behavior for certain geographic regions.
When a contact is inserted, the default information should be set on the contact from the custom metadata records based on the contact's address information.
Additionally, if a user attempts to delete a contact that belongs to a flagged region, the user must get an error message.
Depending on company personnel resources, what are two ways to automate this?
Choose 2 answers

Question29: A developer is developing a reusable Aura component that will reside on an sObject Lightning page with the following HTML snippet:

How can the component"5 controller get the context of the Lightning page that the sObject is on without requiring additional test coverage?

Question30: A company wants to run different logic based on an Opportunity's record type.
Which code segment handles this request and follows best practices?

Question31: Universal Charities (UC) uses Salesforce to collect electronic donations in the form of credit card deductions from individuals and corporations.
When a customer service agent enters the credit card information, it must be sent to 8 3rd-party payment processor for the donation to be processed, UC uses one payment processor for individuals and a different one for corporations.
What should a developer use to store the payment processor settings for the different payment processors, so that their system administrator can modify the settings once they are deployed, if needed?

Question32: A developer is asked to develop a new AppFxchange application. A feature of the program creates Survey records when a Case reaches a certain stage and is of a certain Record Type. This feature needs to be configurable, as different Salesforce instances require Surveys at different times. Additionally, the out-of-the-box AppExchange app needs to come with a set of best practice settings that apply to most customers.
What should the developer use to store and package the custom configuration settings for the app?

Question33: A developer is creating a Lightning web component that displays a list of records in a lightning-datatable. After saving a new record to the database, the list is not updating.

What should the developer change in the code above for this to
happen?

Question34: A developer is building a Lightning web component that searches
for Contacts. The component must communicate the search
results to other unrelated Lightning web components, that are in
different DOM trees, when the search completes.
What should the developer do to implement the communication?

Question35: Just prior to a new deployment the Salesforce administrator, who configured a new order fulfillment process feature in a developer sandbox, suddenly left the company.
Ag part of the UAT cycle, the users had fully tested all of the changes in the sandbox and signed off on them; making the Order fulfillment feature ready for its go-live in the production environment.
Unfortunately, although a Change Set was started, it was not completed by the former administrator.
A developer is brought in to finish the deployment.
What should the developer do to identify the configuration changes that need to be moved into production?

Question36: Assuming the CreateOneAccount class creates one account and implements the Queueable interface, which syntax properly tests the Apex code?

Question37: Universal Containers (UC) has enabled the translation workbench and has translated picklist values. UC has a custom multi-select picklist field, Product__c, on the Account object that allows sales reps to specify which of UC's products an Account already has. A developer is tasked with writing an Apex method that retrieves Account records, including the Product_c field.
What should the developer do to ensure the value of Products__c is in the current user's language?

Question38: A developer has a Visualforce page that automatically assigns ewnership of an Account to a queue upon save. The page appears to correctly assign ownership, but an assertion validating the correct ownership fails.
What can cause this problem?

Question39: Refer to the component code and requirements below:

Question40: Universal Containers uses a custom Lightning page to provide a mechanism to perform a step-by-step wizard search for Accounts. One of the steps in the wizard is to allow the user to input text into a text field, ERF Number_c, that is then used in a query to find matching Accounts.

Which step should be taken to resolve the issue?

Question41: Universal Containers wants to use a Customer Community with Customer Community Plus licenses to allow their customers access to track how many containers they have rented and when they are due back. Universal Containers uses a Private sharing model for External users, Many of their customers are multi-national corporations with complex Account hierarchies. Each account on the hierarchy represents a department within the same business, One of the requirements is to allow certain community users within the same Account hierarchy to see several departments' containers, based on a custom junction object that relates the Contact to the various Account records that represent the departments.
Which solution solves these requirements?

Question42: An environment has two Apex triggers: an after-update trigger on Account and an after-update trigger on Contact.
The Account after-update trigger fires whenever an Account's address is updated, and it updates every associated Contact with that address. The Contact after-update trigger fires on every edit, and it updates every Campaign Member record related to the Contact with the Contact's state.
Consider the following: A mass update of 200 Account records' addresses, where each Account has 50 Contacts. Each Contact has one Campaign Member. This means there are 10,000 Contact records across the Accounts and 10,000 Campaign Member records across the contacts.
What will happen when the mass update occurs?

Question43: A company's support process dictates that any time a case is closed with a status of "Could net fix," an Engineering Review custom object record should be created and populated with information from the case, the contact, and any of the products associated with the case.
What Is the correct way to automate this using an Apex trigger?

Question44: Given a list of Opportunity records named opportunityList, which code snippet is best for querying all Contacts of the Opportunity's Account?

Question45: What is the optimal way to fix this?

Question46: A company uses Salesforce to sell products to customers. They also have an external product information management (PIM) system that is the system of record for products.
A developer received these requirements:
* Whenever a product is created or updated in the PIM, a product must be created or updated as a Product? record in Salesforce and a PricebookEntry record must be created or updated automatically by Salesforce.
= The PricebookEntry should be created in a Priceboek2 that is specified in a custom setting.
What should the developer use to satisfy these requirements?

Question47: Universal Containers uses Big Objects to store almost a billion customer transactions called customer_Transaction_ b.
These are the fields on customer Transaction b:

The following fields have been identified as Index Fields for the Customexr_Transaction__b object: Account__g, Program__c, and Transaction Date_ co.
Which SOQL query is valid on the customer_Transaction_b Big Object?

Question48: A developer created and tested a Visualforce page in their developer sandbox, but now receives reports that user encounter view state errors when using it in production.
What should the developer ensure to correct these errors?

Question49: An Apex trigger and Apex class increment a counter, Edit __C, any time the Case is changed.

Question50: Refer to the test method below''

The test method calls a web service that updates an external system with Account information and sets the Accounts integration_Updated__c checkbox to True when it completes.
The test fails to execute and exits with an error: "Methods defined as TestMethod do not support Web service callouts."

Question51: How can a developer efficiently incorporate multiple JavaScript libraries in an Aura component?

Question52: Universal Containers (UC) has an ERP system that stores customer Information, When an Account is created in Salesforce, the ERP system's REST endpoint for creating new customers must automatically be called with the Account information. If the call to the ERP system falls, the Account should still be created. Accounts in the UC org are only created, one at a time, by users in the UC customer on-boarding department.
What should a developer implement to make the call to the ERP
system's REST endpoint?

Question53: A business currently has a process to manually upload orders from its external Order Management System (OMS) into Salesforce.
This is a labor intensive process since accounts must be exported out of Salesforce to get the IDs. The upload file must be updated with the correct account IDs to relate the orders to the corresponding accounts.
Which two recommendations should make this process more efficient?
Choose 2 answers

Question54: Consider the queries in the options below and the following Information:
* For these queries, assume that there are more than 200,000 Account records.
* These records Include soft-deleted records; that is, deleted records that are still in the Recycle Bin.
* There are two fields that are marked as External Id on the
Account. These fields are customer_Number_c and ERR_Key_ s.
Which two queries are optimized for large data volumes?
Choose 2 answers

Question55: A developer created a Lightning web component for the Account record page that displays the five most recently contacted Contacts for an Account. The Apex method, Contacts, returns a list of Contacts and will be wired to a property in the component.

Which two lines must change in the above code to make the Apex method able to be wired?
Choose 2 answers

Question56: A developer is working with existing functionality that tracks how many times a stage has changed for an Opportunity. When the Opportunity's stage is changed, a workflow rule is fired to increase the value of a field by one. The developer wrote an after trigger to create a child record when the field changes from 4 to 5.
A user changes the stage of an Opportunity and manually sets the count field to 4. The count field updates to 5, but the child record is not created.
What is the reason this is happening?

Question57: A developer is responsible for formulating the deployment process for a Salesforce project. The project follows a source-driven development approach, and the developer wants to ensure efficient deployment and version control of the metadata changes.
Which tool or mechanism should be utilized for managing the source-driven deployment process?

Question58: Which tag should a developer use to display different text while an <apex:commandButton> is Processing an action?

Question59: What is a benefit of JavaScript remoting over Visualforce Remote Objects?

Question60: An Apex trigger creates a Contract record every time an Opportunity record is marked as Closed and Won. This trigger is working great, except (due to a recent acquisition) historical Opportunity records need to be loaded into the Salesforce instance.
When a test batch of records are loaded, the Apex trigger creates Contract records.
A developer is tasked with preventing Contract records from being created when mass loading the Opportunities, but the daily users still need to have the Contract records created.
'What is the most extendable way to update the Apex trigger to accomplish this?

Question61: A Visualforce page needs to make a callout to get billing information and tax information from two different REST endpoints. The information needs to be displayed to the user at the same time and the return value of the billing information contains the input for the tax information callout. Each endpoint might take up to two minutes to process.
How should a developer implement the callouts?

Question62: A developer wrote a class named asccuntRisteryManager that relies on field history tracking. The class has a static method called getaccountHistory that Lakes in an Account as a parameter and returns a list of associated accountHistory object records.
The following test fails:

What should be done to make this test pass?

Question63: A developer writes a Lightning web component that displays a dropdown list of all custom objects in the org from which a user will select. An Apex method prepares and returns data to the component.
What should the developer do to determine which objects to include in the response?

Question64: The Salesforce admin et Cloud Kicks created a custom object called Region_c to store all postal zip codes in the United States and the Cloud Kicks sales region the zip code belongs to.

Cloud Kicks wants a trigger on the Lead to populate the Region based on the Lead's zip code.
Which code segment is the most efficient way to fulfill this request?

Question65: A developer needs to store variables to control the style and behavior of a Lightning Web Component.
Which feature can be used to ensure that the variables are testable in both Production and all Sandboxes?

Question66: A business requires that every parent record must have a child record. A developer writes an Apex method with two DML statements to insert a parent record and a child record.
A validation rule blocks child records from being created. The method uses a try/catch block to handle the DML exception.
What should the developer do to ensure the parent always has a child record?

Question67: Which scenario requires a developer to use an Apex callout
Instead of Outbound Messaging?

Question68: Given the following code:

Assuming there were 10 Contacts and five Accounts created today, what is the expected result?

Question69: A Salesforce Platform Developer is leading a team that is tasked with deploying a new application to production. The team has used source-driven development, and they want to ensure that the application is deployed successfully.
What tool or mechanism should be used to verify that the deployment is successful?

Question70: Business rules require a Contact ta always be created when a new Account is created.
What can be used when developing a custom screen to ensure an Account is not created if the creation of the Contact fails?

Question71: A developer is trying to access org data from within a test class.
Which sObject type requires the test class to have the (seeAllData=true) annotation?

Question72: A developer is tasked with ensuring that email addresses entered into the system for Contacts and for a custom object called survey Response c do not belong to a list of blocked domains.
The list of blocked domains is stored in a custom object for ease of maintenance by users. The survey Response c object is populated via a custom Visualforce page.
What is the optimal way to implement this?

Question73: A company has an Apex process that makes multiple extensive database operations and web service callouts. The database processes and web services can take a long time to run and must be run sequentially.
How should the developer write this Apex code without running into governor limits and system limitations?